package cn.sundat.dao;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;

import cn.sundat.model.Company;
import cn.sundat.model.ProductLink;

public class ProductLinkDaoImpl extends BaseDaoImpl<ProductLink> implements ProductLinkDao {

	@Override
	public List<ProductLink> findLinkByCid(Company company) {
		DetachedCriteria criteria = DetachedCriteria.forClass(ProductLink.class);
		criteria.add(Restrictions.eq("company", company));
		List<ProductLink> list = (List<ProductLink>) this.getHibernateTemplate().findByCriteria(criteria);
		return list;
	}
	
	

}
